//
//  NetWorkErrorAlterView.m
//  mmbang
//
//  Created by lihuaming on 15/12/2.
//  Copyright © 2015年 iyaya. All rights reserved.
//

#import "NetWorkErrorAlterView.h"
#import "UILabel+ALStyledLabel.h"
@implementation NetWorkErrorAlterView

- (id)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.layer.cornerRadius = 4.;
        self.clipsToBounds = YES;
        self.backgroundColor = [UIColor colorWithHex:0xffffff alpha:.9];
        
        UIImageView *imageView = [[UIImageView alloc] initWithImage:[UIImage imageNamed:@"im_bb"]];
        imageView.top = 28;
        imageView.centerX = self.centerX;
        [self addSubview:imageView];
        
        
        UILabel *label = [TKUtil createLabel:[TKFont heiti:16] color:[UIColor colorWithHex:0x333333 alpha:1.]];
        label.numberOfLines = 0;
        label.text = @"遇到了一个难题\n技术GG全力抢救中～";
        [label setLineSpace:10. alignment:NSTextAlignmentCenter];
        label.width = self.width;
        CGRect  rect = [label textRectForBounds:CGRectMake(0, 0, self.width, FLT_MAX) limitedToNumberOfLines:2];
        label.top = imageView.bottom + 20;
        label.height = ceilf(rect.size.height);
        label.centerX = self.centerX;
        [self addSubview:label];
        
    }
    return self;
}

@end
